<?php
/**
 * This file is part of PHPlaza (http://code.google.com/p/phplaza)
 * This file is licensed under the GNU Lesser General Public License
 *      http://www.gnu.org/licenses/lgpl.html
 *
 * No warranty is given, express or implied. Use at your own risk.
 */

namespace core::services::render::html;
use core::services as services;
use core::components as comp;

class Form extends HTMLRenderer
{
	public function render()
	{
		$service = services::ServiceRegistrator::getInstance()->getURLService();
		$this->service->addData('<form method="POST" action="' . $service->getPageUrl() . '">');
		
		$renderService = services::ServiceRegistrator::getInstance()->getRenderService();
		foreach($this->component->getChildren() as $child)
		{
			$renderService->getRenderer($child)->render();
		}
		
		$this->service->addData('</form>');
	}
}